<template>
  <div class="Aside-wrap">
    <el-menu
      :default-active="$route.path"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
      router
      unique-opened
    >
      <el-menu-item index="/index">
        <i class="el-icon-setting"></i>
        <span slot="title">首页</span>
      </el-menu-item>
      <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-tickets"></i>
          <span>单项</span>
        </template>
        <el-menu-item-group>
          <el-menu-item
            v-for="item in forms"
            :key="item.path"
            :index="item.path"
            >{{ item.name }}</el-menu-item
          >
        </el-menu-item-group>
      </el-submenu>
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-s-custom"></i>
          <span>服务</span>
        </template>
        <el-menu-item-group>
          <el-menu-item
            :index="item.path"
            v-for="item in services"
            :key="item.path"
            >{{ item.name }}</el-menu-item
          >
        </el-menu-item-group>
      </el-submenu>
    </el-menu>
  </div>
</template>

<script>
export default {
  data() {
    return {
      forms: [
        { name: "物流单", path: "/logistics" },
        { name: "送货单", path: "/deliveryForm" },
      ],
      services: [
        { name: "我的客户", path: "/myClient" },
        { name: "走访", path: "/visit" },
      ],
    };
  },
  methods: {
    handleOpen() {},
    handleClose() {},
  },
};
</script>
 
<style lang="less" scoped>
.Aside-wrap {
  height: 100%;
  .el-menu {
    height: 100%;
  }
}
</style>